home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / mail / mh / contrib / 9209 / prune-mail < prev    next >
Text File  |  1992-09-20  |  822b  |  24 lines

  1. #! /bin/csh -f
  2. # eliminate all messages in $1 with duplicate message-ids
  3. #
  4. # Subject: MH utility to delete duplicate messages in a folder
  5. # Date: Wed, 19 Aug 92 11:48:45 -0400
  6. # From: Bob Munck <munck@Stars.Reston.Unisys.COM>
  7. # I debated using "$1" everywhere I have "+$1", since the user
  8. # would then need the "+" and would be following MH conventions
  9. # more closely.  I suppose a real convention-following utility
  10. # would also allow defaulting by using Path from ~/.mh-profile
  11. # to find context and getting Current-Folder from it.  
  12.  
  13. if ( ( $#argv == 0 ) || ( $1 == -help ) || ( $1 == -h ) ) then
  14.    echo 'USAGE: prune-mail folder'
  15.    exit 0
  16.    endif
  17. folder +$1
  18. set s =  `scan +$1 -format "%4(putnumf(msg))    %{message-id}"|sort +1|uniq -d +5|sed 's/    .*$//'`
  19. if ( "$s" != "" ) then
  20.    rmm $s +$1
  21.    folder +$1
  22.    endif
  23.